<div id="product_content" class="product_container pb50">
    <h2 th:text="*{name} + ' ' + *{defaultSku.Id}"></h2>

    <div id="price" th:if="${#object instanceof T(org.broadleafcommerce.core.catalog.domain.ProductBundle)}">
        <div blc:fsprice="*{salePrice}" th:if="*{onSale}" th:classappend="*{onSale}? 'sale'"></div>
        <div blc:fsprice="*{retailPrice}" th:classappend="*{onSale}? 'has-sale'"></div>
    </div>

    <div class="product_param">
        <dl id="price" th:unless="${#object instanceof T(org.broadleafcommerce.core.catalog.domain.ProductBundle)}">
            <dt>售价：</dt>
            <dd class="p_param">
                <!-- <div blc:fsprice="*{defaultSku.salePrice}" th:if="*{defaultSku.onSale}" th:classappend="*{defaultSku.onSale}? 'sale'"></div>
                <div blc:fsprice="*{defaultSku.foreignPrice}" th:classappend="*{defaultSku.onSale}? 'has-sale'"></div> -->
                <strong blc:fsprice="*{defaultSku.displayedTotalPrice}" th:classappend="*{defaultSku.onSale}? 'has-sale'"></strong>
            </dd>
        </dl>
        <dl class="select_contry">
            <dt></dt>
            <dd class="p_param flag">
                <span>市场价</span>
                <strong blc:fsprice="*{defaultSku.marketPrice}" th:classappend="*{defaultSku.onSale}? 'has-sale'"></strong>
            </dd>
        </dl>
        <div class="" th:unless="*{#lists.isEmpty(upSaleProducts)}" th:remove="tag">
            <dl th:each="entry, iterStat : *{getRelatedProductGroups(upSaleProducts)}" class="pro_filtrate">
	            <dt th:text="${entry.key} + '：'"></dt>
	            <dd class="">
                    <span th:if="${iterStat.index == 0}" class="pro_filter_self">
                        <a th:if="*{media['primary'] != null}">
                            <img th:src="@{*{media['primary'].url} + '?thumbnail'}" th:alt="*{name}" th:title="*{name}" />
                        </a>
                    </span>
	                <span th:each="upSaleProduct : ${entry.value}" th:object="${upSaleProduct.relatedProduct}">
	                    <th:block th:if="*{isActive() and media['primary'] != null}">
	                        <a th:href="@{*{url}}">
                                <img th:src="@{*{media['primary'].url} + '?thumbnail'}" th:alt="*{name}" th:title="*{name}" />
                            </a>
	                    </th:block>
	                </span>
	            </dd>
	        </dl>
        </div>
        <dl class="product_send" th:unless="*{source}==null or *{source} == ''">
            <dt>配送：</dt>
            <dd>本商品由<span th:text="*{source}"></span>拥有及销售</dd>
        </dl>
        <dl class="overseas_send" th:if="${product.isBroad}">
            <img blc:src="@{/img/20_date_send.jpg}" th:alt="20个工作日不到货现金赔付" />
        </dl>
        <div class="product-options" th:substituteby="catalog/partials/productOptions" />
        <div class="product-option-nonjs" th:each="productOption : *{productOptions}" th:object="${productOption}">
            <div class="form50">
                <label th:text="*{label}"></label>
                <select th:name="${'itemAttributes[' + productOption.attributeName + ']'}">
                    <option th:each="optionValue : *{allowedValues}" th:object="${optionValue}" th:text="*{attributeValue}"></option>
                </select>
            </div>
        </div>
        
        <th:block th:with="checkInventory=*{defaultSku.inventoryType?.type == 'CHECK_QUANTITY'}, 
            availableInventory=${checkInventory ? #object.defaultSku.quantityAvailable != null and #object.defaultSku.quantityAvailable != 0 : true}, 
            inCart=${cart.containsSku(#object.defaultSku) and #lists.isEmpty(product.productOptions)}">
            <div>
                <div class="rep clearfix">
                    <div class="surplus">
                        <div class="rep_pannel"><span class="rep_mark"></span></div>
                    </div>
                    <div class="pep_num">
                        <div class="join j_surp">
                            <span>参加人次</span>
                            <span id="rep_surplus" th:text="*{defaultSku.quantityTotal - defaultSku.quantityAvailable}">350</span>
                        </div>
                        <div class="join j_all">
                            <span>总人次</span>
                            <span id="rep_total" th:text="*{defaultSku.quantityTotal}">450</span>
                        </div>
                        <div class="join j_in">
                            <span>剩余人次</span>
                            <span th:text="*{defaultSku.quantityAvailable}">100</span>
                        </div>
                    </div>
                </div>
                <div class="loot">
                    <blc:form method="POST" th:action="@{/cart/add}">
                       <div class="add_to_cart" th:classappend="${!availableInventory}? ' hidden'">
                           <input type="hidden" name="productId" th:value="*{id}" />
                           <input type="hidden" name="quantity" value="1" id="atc_num" />
                           <input type="submit" class="addToCart big red" th:value="#{product.treasure}" />
                       </div>
                        <p class="error" th:if="${param.errorMessage}" th:text="${param.errorMessage[0]}"></p>
                    </blc:form>
                </div>
            </div>
	        <div class="all_buy_btn">
	            <div id="inventory" th:if="${checkInventory}">
                    <div class="invet_num">
    	                <span th:text="#{product.inventory}"></span>
    	                <span th:text="*{defaultSku.quantityAvailable == null ? '0' : defaultSku.quantityAvailable}"></span>
    	                <span>件</span>
                    </div>
                    <div th:if="${!availableInventory}" class="out_of_stock" th:classappend="loot">
                        <a disabled="disabled" class="big-button gray-button"
                            th:text="#{product.treasureOutOfStock}">已抢光</a>
                    </div>
	            </div>
	        </div>
        </th:block>
    </div>
    <div class="db_pannel">
        <h3><span>0元夺宝</span></h3>
        <div class="db_box">
            <input id="deadline" type="hidden" th:value="*{defaultSku.activeEndDate}"/>
<!--             <input id="deadline" type="hidden" value="2015-03-05 15:00:00.0"/> -->
            <span class="db_p_tit">夺宝结束倒计时:</span>
            <div class="tr_count_down clearfix">
                <div class="count_down">
                    <span class="ct cd_d">
                        <s class="cd_d_1"></s>
                        <s class="cd_d_2"></s>
                    </span>
                    <span class="ct cd_h">
                        <s class="cd_h_1"></s>
                        <s class="cd_h_2"></s>
                    </span>
                    <span class="ct cd_m">
                        <s class="cs cd_m_1"></s>
                        <s class="cd_m_2"></s>
                    </span>
                    <span class="ct cd_s">
                        <s class="cd_s_1"></s>
                        <s class="cd_s_2"></s>
                    </span>
                </div>
                <div class="count_info">
                    <span class="cc">天</span>
                    <span class="cc">小时</span>
                    <span class="cc">分</span>
                    <span class="cc">秒</span>
                </div>
            </div>
        </div>
        <div class="db_sure">
            <span>1元押金100%全退</span>
        </div>
    </div>
    <div class="share">
        <p class="sh_title">
            <a class="" th:if="${customer.anonymous and product.isBroad}" th:href="@{/login}" th:text="#{login.loginBefore}">Login before</a>
            <span th:text="#{product.share}">Share</span><span th:if="*{isBroad}" th:text="#{product.forRebate}"> and get rebate!</span>
            <!-- JiaThis Button BEGIN -->
        <div class="jiathis_style_32x32">
            <a class="jiathis_button_weixin"></a>
            <a class="jiathis_button_tsina"></a>
            <a class="jiathis_button_tqq"></a>
            <a class="jiathis_button_copy"></a>
            <a href="http://www.jiathis.com/share" class="jiathis jiathis_txt jtico jtico_jiathis" target="_blank"></a>
        </div>
        <script type="text/javascript" charset="utf-8" th:inline="javascript">
            /*<![CDATA[*/
            var jiathis_config={
                url:[[${referralURL}]],
                title:"我发现一个很不错的智能产品！" + [[*{name}]] + "，" + [[*{defaultSku.shortDescription == null?"":defaultSku.shortDescription}]],
            summary:"\n在「范客生活」就能买到！现在做活动全场包邮，海淘商品20天不到，还能现金赔付。",
                pic:[[${referralImgURL}]],
                shortUrl:false,
                hideMore:false
            /*data_track_clickback:true*/
            }
            /*]]>*/
        </script>
        <script type="text/javascript" src="http://v3.jiathis.com/code/jia.js" charset="utf-8"></script>
        </p>
    </div>

</div>
